import request from '@/api/request'

// 获取文章列表
export function requestArticleList(info, data) {
  return request({
    method: 'post',
    url: `/lejuAdmin/productArticle/findArticles/${info.start}/${info.limit}`,
    data
  })
}

// 删除文章列表
export function deleteArticle(id) {
  return request({
    method: 'delete',
    url: `/lejuAdmin/productArticle/del/${id}`
  })
}

// 改变文章显示状态
export function changeShowStatus(data) {
  return request({
    method: 'post',
    url: `/lejuAdmin/productArticle/changeShowStatus`,
    data
  })
}

// 新增文章
export function addArticle(data) {
  return request({
    method: 'post',
    url: `/lejuAdmin/productArticle/addArticle`,
    data
  })
}

// 获取文章明细
export function productArticle(id) {
  return request({
    method: 'get',
    url: `/lejuAdmin/productArticle/productArticle/${id}`
  })
}

//  更新文章
export function updataArticle(data) {
  return request({
    method: 'post',
    url: `/lejuAdmin/productArticle/updateArticle`,
    data
  })
}

// 获取文章列表
export function requestMaterialList(info, data) {
  return request({
    method: 'get',
    url: `/lejuAdmin/material/findMaterialByPage/${info.start}/${info.limit}`,
    data
  })
}

// 素材上传
export function uploadMaterial(data) {
  return request({
    method: 'post',
    url: `/lejuAdmin/material/uploadFileOssSave`,
    data
  })
}

// 删除素材
export function deleteMaterial(id) {
  return request({
    method: 'delete',
    url: `/lejuAdmin/material/delMaterial/${id}`
  })
}
